package operations;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class FindOperation implements IOperation {

    public void work(BookList bookList){
        System.out.println("查找");
        System.out.println("输入查找的图书");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        for (int i = 0; i < bookList.usedSize; i++) {
            Book book = bookList.getPos(i);
            if(name.equals(book.getName())){
                System.out.println("找到了");
                return;
            }
        }
        System.out.println("没找到");
    }

}
